package controller;

import entity.User;
import org.springframework.stereotype.Controller;
import org.springframework.ui.Model;
import org.springframework.ui.ModelMap;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.ResponseBody;

import javax.servlet.http.HttpServletRequest;
import java.io.PrintWriter;
import java.io.Reader;
import java.io.UnsupportedEncodingException;
import java.io.Writer;
import java.util.Map;

/**
 * Auther:ws@itany.com
 * Date:20-9-17 上午11:00
 * Version:1.0
 * Description:
 */
@Controller
@RequestMapping("/parm")
public class ParmController {
    @RequestMapping("/f4")
    public void f4(Reader read, Writer writer, PrintWriter out){
        out.print("<h1>ahahahah<h1>");
    }

    @RequestMapping("/f5")
    public String f5(Model model, Map map, ModelMap modelMap){
        model.addAttribute("model","Hello Model");
        map.put("map", "Hell Map");
        modelMap.addAttribute("modelMap","Hello ModelMap");
        modelMap.put("modelMap2","Hello ModelMap");
        return "redirect:showModel";
    }

    @RequestMapping("/f6")
    public void f5(User user){
       System.out.print(user);
    }
}
